const router = require('koa-router')()
const {getPublicShare} = require('../service/get-general-share')
router.prefix('/share')

router.post('/getPublic', async (ctx, next) => {
    try {
        let postDate = ctx.request.body,
            pageNum = postDate.pageNum,
            pageSize = postDate.pageSize,
            orderByField = postDate.orderByField,
            info = await getPublicShare(pageNum, pageSize)
        ctx.body = JSON.stringify(info)
    } catch (err) {
        ctx.body = JSON.stringify({
            statusCode: 0
        })
    }
})

router.get('/index', async (ctx, next) => {
})

module.exports = router